﻿using UnityEngine;
using System.Collections;

public class buttonHead : MonoBehaviour
{

    // Use this for initialization
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        GameObject obj = GameObject.FindGameObjectWithTag("head");
        Vector3 rotateHead = new Vector3();
        Vector3 rotateButton = new Vector3();
        rotateHead = obj.GetComponent<Transform>().eulerAngles;
        rotateButton = this.GetComponent<Transform>().eulerAngles;
        rotateButton.y = rotateHead.y;
        this.GetComponent<Transform>().eulerAngles = rotateButton;
    }
}
